package test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

public class test {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"aaa","bbb","ccc");
        Iterator<String> it=list.iterator();
        while(it.hasNext()){
            String s = it.next();
            System.out.println(s);
            it.remove();
            System.out.println(list);
        }
    }
}
